![]() |
PATH![]() |
![]() ![]() |
Here's how to declare a button label drawing function, if you were to name the function MyThemeButtonDrawProc :
pascal void MyThemeButtonDrawProc (
const Rect *bounds,
ThemeButtonKind kind,
ThemeButtonDrawInfo *info,
UInt32 userData,
SInt16 depth,
Boolean isColorDev);
At the time your button label drawing function is called, the foreground text color and mode is already set to draw in the correct state (active or inactive) and correct color for the theme. You do not need to set the color unless you have special drawing needs. If you do have special drawing needs, you should supply the depth value and the value of the isColorDevice parameter to the function IsThemeInColor to determine whether or not you should draw your content in color. Note that the Appearance Manager calls your MyThemeButtonDrawProc function for every device that the bounds rectangle intersects.
The Appearance Manager draws the button background prior to calling your button label drawing function, so you should not erase the button background from your label drawing function.